<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
	xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">
<head th:include="inc/examHeader::header">
</head>
<body>
	<!--返回-->
	<div class="back" onclick="location='/index'">
		<img src="/images/back.png" />
	</div>
	<div th:include="header :: header"></div>
	<div class="header-title">
		<span>参加考试</span>
	</div>
	<div class="spare-a">
		<div class="spare-al">
			<div style="height: 10px"></div>
			<ul>
				<a href="/examReport/wtake.html"><li class="active"><p>未参加考试</p></li></a>
				<a href="/examReport/take.html"><li><p>已参加考试</p></li></a>
			</ul>
		</div>
		<div class="spare-ar">
			<div class="spare-ara">
				<div class="spare-ara-a clearfix">
					<div class="spare-ara-al">
						<div class="spare-ara-all">
							<input type="text" placeholder="请输入试卷名称" id="search"
								th:value="${params}" />
						</div>
						<div class="spare-ara-alr" onclick="js_method()"></div>
					</div>
				</div>
				<div class="srcoll-documentation" id="srcoll-documentation" shiro:hasPermission="sys:taketest:view">
					<div class="documentation nottake">
						<ul class="lists" id="lists">
					
						</ul>
					</div>
				</div>
			</div>
		</div>
	</div>

</body>
	<script th:inline="javascript">
		/*<![CDATA[*/
		$(function() {	
	 		loadDataPage("/examReport/paperM/wtake", "srcoll-documentation",
					"lists", 12, "search"); 
		});
		//构建数据列表
 		function dataKk(data, me) {
			var result = '';
			var arrLen = data.length;
			if (arrLen > 0) {
				for (var i = 0; i < arrLen; i++) {
					result += '<a href="#">' + '<li onClick="skipToWcj(this.id)" id='+data[i].id+'>'
							+ '<div class="paper-a">试卷名称：' + data[i].name+ '</div>'
							+ '<div class="paper-b">考试时长（分钟）：' + data[i].totalTime + '<span>试卷类型：' + data[i].examType+ '</span>'+ '</div>'
							+ '<div class="paper-c">创建日期：' + data[i].createDate+ '</div>'
							+ '<div class="documentation-check"></div>'
							+ '</li>' + '</a>'
				}
			} else {
				me.lock();
				me.noData();
			}
			return result; 
		} 
		
 		function skipToWcj(id){
 			var examT=$("#"+id+"").find("span").text();
 			if(examT=="试卷类型：现场考试"){
 				zebra_Dialog_warning("此试卷为现场考试试卷，请重新选择!");
 			}else{
 				window.location.href="/examReport/wtake-xq?paperId="+id;
 			}
 	    }
 		 
 		function js_method() {
 			$(".dropload-down").remove();
 			$('#lists').html("");
 			loadDataPage("/examReport/paperM/wtake", "srcoll-documentation", "lists", 12,"search");	
 		}
		/*]]>*/
	</script>
</html>
